<!-- html -->
<template>
  <h2 class="h2">v-for，列表渲染</h2>
  <li class="li1" v-for="item in persons" :key="item.id">
    <span class="span2">id：{{ item.id }}，name：{{ item.name }}，age：{{ item.age }}</span>
  </li>
</template>

<!-- js或ts -->
<script lang="ts">
export default {
  name: 'vifTest1'
}
</script>

<!-- js或ts -->
<script setup lang="ts">
import { Persons2 } from '@/assets/interface/Person'
//数据
let persons: Persons2 = [{
  id: '1',
  name: '张三',
  age: 18
}, {
  id: '2',
  name: '李四',
  age: 19
}
]
</script>

<!-- 样式 -->
<style scoped></style>